<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="vue.js"></script>
    <title>Document</title>
   <style>
       div{
           width: 300px;
           height: 3px;
           border: 1px solid black;
           margin-top: 20px;
       }
       span{
           background-color: black;
           position: absolute;
           border:1px solid black;
           width: 3px;
           height: 3px;
       }
   </style>
</head>
<body>
    <main id="app"> 
        <input type="text" v-model="index">
        <div  @mousedown="down($event)">
            <span :style='"left:"+index/100*300+"px"'></span>
        </div>
    </main>
    <script>
        var vue=new Vue({
            el:'#app',
            data:{
               index:0,
            },
            methods:{
                down:function(e){
                   var pointX=e.pageX
                   this.index=(pointX)/300*100
                   console.log(this.index)
                }
            }
        })
    </script>
</body>
</html>